<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script>
			/* var a = [1,2,3,4,5,6,7,8,9,10];
			var d = new Date();
			var t = 0;
			var time1 = d.getTime();
			for(var i=0;i<5;i++){
				t = a[i];
				a[i] = a[9-i];
				a[9-i] = [i];
			}
			var time2 = d.getTime();
			var time = time2-time1;
			console.log(time); */
			var b = 100000;
			var d = new Date();
			var time1 = d.getSeconds();
			for(var i=0;i<10000;i++){
				b--;
			}
			var time2 = d.getSeconds();
			var time = time2-time1;
			console.log(time);
			var arr = [1,2,3,4,5]
			arr.forEach((item,index) => {
				console.log(item,index)
			})
			arr.filter((item,index) => {
				console.log(item,index)
			})
			arr.flatMap((item,index) => {
				console.log(item,index)
			})
			/*
			除了常见的for(var i = 0; i<m; i++) 这种格式外，
			for循环还存在for in
			map
			foreach等方法,formap和foreach的区别在于formap实际上会产生新的数组，在formap循环中进行修改
			不会改变原数组或对象的值
			*/
		</script>
	</body>
</html>
